import 'package:safetymonitor/generated/json/base/json_convert_content.dart';
import 'package:safetymonitor/app/data/entities/application/security_control_promise_entity.dart';

SecurityControlPromiseEntity $SecurityControlPromiseEntityFromJson(Map<String, dynamic> json) {
  final SecurityControlPromiseEntity securityControlPromiseEntity = SecurityControlPromiseEntity();
  final int? id = jsonConvert.convert<int>(json['id']);
  if (id != null) {
    securityControlPromiseEntity.id = id;
  }
  final String? path = jsonConvert.convert<String>(json['path']);
  if (path != null) {
    securityControlPromiseEntity.path = path;
  }
  final int? uploadTime = jsonConvert.convert<int>(json['uploadTime']);
  if (uploadTime != null) {
    securityControlPromiseEntity.uploadTime = uploadTime;
  }
  final String? uploader = jsonConvert.convert<String>(json['uploader']);
  if (uploader != null) {
    securityControlPromiseEntity.uploader = uploader;
  }
  return securityControlPromiseEntity;
}

Map<String, dynamic> $SecurityControlPromiseEntityToJson(SecurityControlPromiseEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['id'] = entity.id;
  data['path'] = entity.path;
  data['uploadTime'] = entity.uploadTime;
  data['uploader'] = entity.uploader;
  return data;
}

extension SecurityControlPromiseEntityExtension on SecurityControlPromiseEntity {
  SecurityControlPromiseEntity copyWith({
    int? id,
    String? path,
    int? uploadTime,
    String? uploader,
  }) {
    return SecurityControlPromiseEntity()
      ..id = id ?? this.id
      ..path = path ?? this.path
      ..uploadTime = uploadTime ?? this.uploadTime
      ..uploader = uploader ?? this.uploader;
  }
}